package com.minshenglife.zanzan.service.manage;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.minshenglife.commons.dal.Page;
import com.minshenglife.zanzan.entity.ComplainCount;
import com.minshenglife.zanzan.entity.Dept;
import com.minshenglife.zanzan.entity.DeptCount;
import com.minshenglife.zanzan.entity.ManagerMail;
import com.minshenglife.zanzan.entity.ReviewCount;
import com.minshenglife.zanzan.entity.User;
import com.minshenglife.zanzan.entity.UserLog;
import com.minshenglife.zanzan.entity.WorkLogCount;
import com.minshenglife.zanzan.entity.WorkLogCountWeek;
import com.minshenglife.zanzan.result.EmpWorkCon;
import com.minshenglife.zanzan.result.ManagerResult;

/**
 * @author Hao HaiLin
 *
 */
public interface ManagerService {
	/**
	 * 统计红花数、送花数和积分
	 * @param map
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	public Page<User> countAll(Map<String,Object> map,int pageNo,int pageSize);
	/**
	 * 统计部门红花总数、送花总数、积分总数
	 * @param map
	 * @return
	 */
	public List<DeptCount> countByDept(Map<String,Object> map);
	
	/**
	 * 导出数据为柱状图
	 * @param deptCountList
	 * @param session
	 * @param request
	 * @return
	 */
	public String getImageUrl(List<DeptCount> deptCountList,HttpSession session,HttpServletRequest request );
	/**
	 * 导出数据为EXCEL表格
	 * @param map
	 */
	public void getExcel(Map<String,Object> map,List<User> userList,OutputStream out);
	
	/**
	 * 统计EXCEL表格所需数据
	 * @param map
	 * @return
	 */
	public List<User> countForExcel(Map<String,Object> map);
	
	/**
	 * 统计用户操作日志
	 * @param map
	 * @return
	 */
	public Page<UserLog> countForLog(Map<String,Object> map,int pageNo,int pageSize);
    /**
     * 统计所有部门信息
     * @return
     */
    public List<Dept> findDept();
    
    public List<User> getUser(String userName,String password);
    
    public Page<User> countRed(Map<String,Object> map,int pageNo,int pageSize);
    public List<User> countRedForExcel(Map<String,Object> map);
    public void getRedExcel(Map<String,Object> map,List<User> userList,OutputStream out);
    public Page<User> countSend(Map<String,Object> map,int pageNo,int pageSize);
    public List<User> countSendForExcel(Map<String,Object> map);
    public void getSendExcel(Map<String,Object> map,List<User> userList,OutputStream out);
    public Page<User> countIntegral(Map<String,Object> map,int pageNo,int pageSize);
    public List<User> countIntegralForExcel(Map<String,Object> map);
    public void getIntegralExcel(Map<String,Object> map,List<User> userList,OutputStream out);
    public Page<ManagerResult> findProgressRank(Map<String,Object> map,int pageNo,int pageSize);
    public void getProgressExcel(Map<String,Object> map,List<ManagerResult> userList,OutputStream out);
    public List<ManagerResult> countProgressForExcel(Map<String,Object> map);
    public Page<ManagerMail> findMail(Map<String,Object> map,int pageNo,int pageSize);
    public ManagerMail findMailContent(Map<String,Object> map);
    public Page<ReviewCount> countReview(Map<String,Object> map,int pageNo,int pageSize);
    public Page<ComplainCount> countComplain(Map<String,Object> map,int pageNo,int pageSize);
    public Page<WorkLogCount> countWorkLog(Map<String,Object> map,int pageNo,int pageSize);      
    public List<WorkLogCount> countWorkLogForExcel(Map<String,Object> map);
    public void getWorkLogExcel(Map<String,Object> map,List<WorkLogCount> userList,OutputStream out);
    public Page<User> countDeptSum(Map<String,Object> map,int pageNo,int pageSize);
    public Page<User> countDeptSendSum(Map<String,Object> map,int pageNo,int pageSize);
    public List<User> countDeptRedForExcel(Map<String,Object> map);
    public void getDeptRedExcel(Map<String,Object> map,List<User> userList,OutputStream out);
    public List<User> countDeptSendForExcel(Map<String,Object> map);
    public void getDeptSendExcel(Map<String,Object> map,List<User> userList,OutputStream out);
    public List<WorkLogCount> countWorkLogBySHYForExcel(Map<String,Object> map);  
    public Page<WorkLogCount> countWorkLogBySHY(Map<String,Object> map,int pageNo,int pageSize);
    
    public Page<WorkLogCount> countBWorkLog(Map<String,Object> map,int pageNo,int pageSize);   
    public List<WorkLogCount> countBWorkLogBySHYForExcel(Map<String,Object> map);
    
    public Page<WorkLogCountWeek> countBWeekWorkLog(Map<String,Object> map,int pageNo,int pageSize);   
    public List<WorkLogCountWeek> countBWorkLogByWeekForExcel(Map<String, Object> map);
    public void getWorkLogWeekExcel(Map<String,Object> map,List<WorkLogCountWeek> userList,OutputStream out);
    
    //不加入顺序
    public Page<WorkLogCountWeek> countBWeekWorkLogNoSoft(Map<String, Object> map,
			int pageNo, int pageSize);
    
    //不加入顺序
    public List<WorkLogCountWeek> countBWorkLogByWeekForExcelNoSoft(
			Map<String, Object> map);
    
    
    public List<EmpWorkCon> selectWorkConAndReviews(Map<String,Object> map);
    
    public void getWorkLogExcel4(Map<String,Object> map,List<EmpWorkCon> userList,OutputStream out);
}
